package tech.aistar.day01;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

@WebServlet(urlPatterns = "/day01/LoginView")
public class LoginViewController extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //1设置文档类型
        resp.setContentType("text/html;charset=utf8");
        //2获取文档输出流
        PrintWriter out = resp.getWriter();
        //3输出内容到网页
        out.println("<!DOCTYPE html>");
        out.println("<html lang='en'>");
        out.println("<head>");
        out.println("<meta charset='UTF-8'>");
        out.println("<meta http-equiv='X-UA-Compatible' content='IE=edge'>");
        out.println("<meta name='viewport' content='width=device-width, initial-scale=1.0'>");
        out.println("<title>");out.println("bootstrap是一款响应式的UI[User-Interface]框架</title>");
        out.println("<!-- 引入bootstrap.css - 开发环境/bootstrap.min.css - 生产环境-->");
        out.println("<link rel='stylesheet' href='plugins/bootstrap-3.4.1-dist/css/bootstrap.css'>");
        out.println("<style>");

        out.println("</style>");
        out.println("</head>");
        out.println("<body>");

        out.println("<!-- Single button -->");
        out.println("<div class='btn-group'>");
        out.println("<button type='button' class='btn btn-default dropdown-toggle' data-toggle='dropdown' aria-haspopup='true' aria-expanded='false'>");
         out.println("Action <span class='caret'>");out.println("</span>");
        out.println("</button>");
        out.println("<ul class='dropdown-menu'>");
        out.println("<li>");out.println("<a href='#'>");out.println("Action </a>");out.println("</li>");
        out.println("<li>");out.println("<a href='#'>");out.println(" Another action</a>");out.println("</li>");
        out.println("<li>");out.println("<a href='#'>");out.println("Something else here </a>");out.println("</li>");
        out.println("<li role='separator' class='divider'>");out.println("</li>");
        out.println("<li>");out.println("<a href='#'>");out.println("Separated link</a>");out.println("</li>");
        out.println("</ul>");
        out.println("</div>");

        out.println("<!-- 引入jquery框架 -->");
        out.println("<script src='plugins/jquery.min.js'>");out.println("</script>");

        out.println("<!-- 引入bootstrap.js/bootstrap.min.js,bootstrap依赖于jquery框架 -->");
        out.println("<script src='plugins/bootstrap-3.4.1-dist/js/bootstrap.js'>");out.println("</script>");
        out.println("</body>");
        out.println("</html>");
    }

}
